package _18define;

public class Main {
    public static void main(String[] args) {
        String originalString = "legendary";
        StringBuilder result = new StringBuilder();
        for (int i = 0; i < originalString.length (); i++) {
            char ch = originalString.charAt (i);
            if (i % 2 == 0) { // 每隔一个字符
                result.append (Character.toUpperCase (ch));
            } else {
                result.append (Character.toLowerCase (ch));
            }
        }
        System.out.println (result);
    }
}

